import ajax from '@/api/ajax'

const { url } = require("../../build/config");

// console.log(config)

//  url.base_url;
const base_url = 'apis'
console.log(`${base_url}/login`)

export function login(data, showMessage) {
  return ajax({
    url: `${base_url}/login`,
    method: 'POST',
    ContentType: "application/x-www-form-urlencoded",
    data,
    showMsg: showMessage,
  })
}


export function getInfo() {
  return ajax({
    url: `${base_url}/api/user`,
    method: 'get',
  })
}

export function logout() {
  return ajax({
    url: `${base_url}/logout`,
    method: 'post'
  })
}
